package com.ssy.lingxi.order.api.model.vo.response;

import com.ssy.lingxi.common.utils.DateTimeUtil;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Optional;

/**
 * 请款类型和付款方过滤采购订单返回VO
 * @author wyx
 * @version 2.0.0
 * @date 2022-01-05
 */
public class OrderBuyerSettleQueryVO implements Serializable {
    private static final long serialVersionUID = -288332376454849484L;

    public OrderBuyerSettleQueryVO() {
    }

    /**
     * 合同id
     */
    private Long contractId;
    /**
     * 订单Id
     */
    private Long orderId;

    /**
     * 订单编号
     */
    private String orderNo;

    /**
     * 订单摘要
     */
    private String digest;

    /**
     * 订单提交时间
     */
    private String createTime;

    /**
     * 单据状态
     */
    private Integer status;

    /**
     * 单据状态名称
     */
    private String statusName;

    /**
     * 订单商品金额 = 商品单价 * 数量
     */
    private BigDecimal amount;

    /**
     * 是否含税
     */
    private Boolean tax;

    /**
     * 订单商品金额
     */
    private BigDecimal productAmount;

    /**
     * 税率（百分比转换的小数）
     */
    private BigDecimal taxRate;

    public OrderBuyerSettleQueryVO(Long contractId, Long orderId, String orderNo, String digest, LocalDateTime createTime, Integer status, BigDecimal amount, Boolean tax, BigDecimal taxRate, BigDecimal productAmount) {
        this.contractId = Optional.of(contractId).orElse(0L);
        this.orderId = orderId;
        this.orderNo = orderNo;
        this.digest = digest;
        this.createTime = DateTimeUtil.formatDate(createTime);
        this.status = status;
        this.amount = amount;
        this.productAmount = productAmount;
        this.tax = tax;
        this.taxRate = taxRate;
    }

    public Long getContractId() {
        return contractId;
    }

    public void setContractId(Long contractId) {
        this.contractId = contractId;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getDigest() {
        return digest;
    }

    public void setDigest(String digest) {
        this.digest = digest;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getStatusName() {
        return statusName;
    }

    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public BigDecimal getProductAmount() {
        return productAmount;
    }

    public void setProductAmount(BigDecimal productAmount) {
        this.productAmount = productAmount;
    }

    public Boolean getTax() {
        return tax;
    }

    public void setTax(Boolean tax) {
        this.tax = tax;
    }

    public BigDecimal getTaxRate() {
        return taxRate;
    }

    public void setTaxRate(BigDecimal taxRate) {
        this.taxRate = taxRate;
    }
}
